﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace weighing
{
    /// <summary>
    /// 摄像头操作的接口
    /// </summary>
    public interface ICamera
    {
        bool InitSDK();
        /// <summary>
        /// 登陆 or 打开 
        /// </summary>
        /// <param name="ip">IP </param>
        /// <param name="port"> 端口</param>
        /// <param name="userName">用户名</param>
        /// <param name="pwd">密码</param>
        /// <param name="deviceInfo">成功后返回的设备信息(海康专用)</param>
        /// <returns>int 成功句丙</returns>
        int Login(string ip, int port, string userName, string pwd, ref CHCNetSDK.NET_DVR_DEVICEINFO_V40 deviceInfo);

        /// <summary>
        /// 登陆 or 打开 
        /// </summary>
        /// <param name="ip">IP </param>
        /// <param name="port"> 端口</param>
        /// <param name="userName">用户名</param>
        /// <param name="pwd">密码</param>
   
        /// <returns>int 成功句丙</returns>
        int Login(string ip, int port, string userName, string pwd);
        /// <summary>
        /// 退出
        /// </summary>
        /// <param name="loginHandle">登陆成功后返回的 句丙</param>
        bool LoginOut(int loginHandle);
        /// <summary>
        /// 预览
        /// </summary>
        /// <param name="pbHandle"> PictureBox 句丙</param>
        /// <param name="channel"> 通道（HK）</param>
        /// <param name="loginHandle">登陆成功返回</param>
        /// <param name="errorCode">错误代码</param>
        /// <returns></returns>
        int Preview(IntPtr pbHandle,int loginHandle, int channec, out uint errorCode);
        /// <summary>
        /// 停止预览
        /// </summary>
        /// <param name="handle"> play handle or login handle</param>
        /// <returns></returns>
        bool StopPreview(int handle);

        /// <summary>
        /// 截图
        /// </summary>
        /// <param name="loginHandle">登录的摄像头 句丙</param>
        /// <param name="filePathName">图片保存路径和文件名</param>
        /// <param name="lChannel">通道号(海康专用)</param>
        /// <param name="quality">压缩图片质量</param>
        bool CaptureJpeg(int loginHandle, string filePathName, int lChannel, int quality);
    }
}
